import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/widgets/bottom_sheet/sort_contact_bottom_sheet.dart';

mixin ContactsSortMixin<T> on BaseProvider<T> {
  String currentSelectSortContact;

  @override
  void initState() {
    currentSelectSortContact = S.current.alphabetical;
    super.initState();
  }

  void unFocus();

  void onSelectSortContact() {
    unFocus();
    obtainContext?.call((context) async {
      currentSelectSortContact =
          await showSortContactBottomSheet(context, currentSelectSortContact);
      sortUpdate();
      update();
    });
  }

  void sortUpdate();
}
